package com.hw.paltfrom.controller.system;

import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hw.paltfrom.pack.ResponseResult;
import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.system.BaseDataltemDetailService;
import com.hw.paltfrom.utils.VerifyUtil;
import com.hw.paltfrom.vo.BaseDataItemDetailVo;

/**
 * 字典明細內容
 * 邢家华
 * 2019-11-6 16:10:54
 * @author Administrator
 *
 */
@RestController
@RequestMapping(value = "/hwBaseDataltemDetail")
public class BaseDataltemDetailController {

	@Autowired
	private BaseDataltemDetailService hwBaseDataltemDetailService;

	// 查询
	@RequestMapping(value = "/query")
	public Map<String, Object> Query(BaseDataItemDetailVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwBaseDataltemDetailService.queryAllList(vo);

	}

	// 父类查询
	@RequestMapping(value = "/queryParentId")
	public Map<String, Object> QueryParentId(BaseDataItemDetailVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwBaseDataltemDetailService.queryParentIdList(vo);

	}

	// 编辑详情
	@RequestMapping(value = "/queryFItemdeTailId")
	public Map<String, Object> QueryFItemdeTailId(BaseDataItemDetailVo vo) {

		String fItemdetailid = vo.getfItemdetailid();
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwBaseDataltemDetailService.queryFItemdeTailId(fItemdetailid);
	}

	// 新增
	@RequestMapping(value = "/insert")
	public Map<String, Object> insert(BaseDataItemDetailVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwBaseDataltemDetailService.insert(vo);
	}

	// 编辑或删除
	@RequestMapping(value = "/update")
	public Map<String, Object> update(BaseDataItemDetailVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}

		return hwBaseDataltemDetailService.update(vo);
	}
	
	// 数据字典侧边栏
	@RequestMapping(value = "/sortList")
	public Map<String, Object> sortList() {
		return hwBaseDataltemDetailService.itemDataSort();
	}
}
